/**
 * Created with JetBrains WebStorm.
 * User: Tao
 * Date: 13-3-16
 * Time: 下午9:25
 * To change this template use File | Settings | File Templates.
 */
Ext.application({

    name:'Demo',

    launch:function(){

        var formPanel = Ext.create('Ext.form.Panel',{

            id:'formPanel',
            scrollable:'vertical',
            baseCls:'bgPink',
            cls:'smallfont',

            items:[
                {
                    xtype:'fieldset',
                    title:'电影信息',
                    instructions:'请填写电影信息',
                    defaults :{
                        labelWidth:'20%'
                    },
                    items:[
                        {
                            xtype:'textfield',
                            id:'txt_title',
                            name:'title',
                            label:'标题',
                            placeHolder:'请输入电影标题',
                            required:true,
                            clearIcon:true,
                            listeners:{
                                change:function(item,newValue,oldValue){
                                    Ext.Msg.alert('修改前的值为'+oldValue);
                                }
                            }
                        },{
                            xtype:'textfield',
                            id:'txt_director',
                            name:'director',
                            label:'导演',
                            placeHolder:'请输入导演名称',
                            clearIcon:true,
                            disabled:true,
                            disabledCls:'disabledColor'
                        }]
                }]
        });
        Ext.Viewport.add(formPanel);
    }
});